Skip to content

Allow parser context to be None #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

sliverc
Copy link
Member

@sliverc sliverc commented Sep 23, 2021

Description of the Change

Default parameter of parser_context was already set to None but would had always raised an error when it was actually None.

DRF parser allows parser_context to be None so this PR makes the DJA parser fully compatible with DRF API.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@sliverc sliverc requested a review from n2ygk September 23, 2021 18:05
@sliverc
Copy link
Member Author

sliverc commented Sep 23, 2021

Just as a follow up I discovered this issue while implementing PR #898. So it is basically an issue which can occur during testing.

@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #981 (fcbca4f) into master (a6644eb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #981   +/-   ##
=======================================
  Coverage   96.82%   96.82%           
=======================================
  Files          65       65           
  Lines        3904     3906    +2     
=======================================
+ Hits         3780     3782    +2     
  Misses        124      124           
Impacted Files Coverage Δ
rest_framework_json_api/parsers.py 98.59% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6644eb...fcbca4f. Read the comment docs.

Default parameter of `parser_context` was already set to `None`
but would had always raised an error.

DRF parser allows `parser_context` to be `None` to so brings DJA to
use the same API.
@sliverc sliverc merged commit 29971b4 into django-json-api:master Sep 23, 2021
@sliverc sliverc deleted the parse_context_none branch September 23, 2021 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants